home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Bavarian / Bavarian #010 (19xx)(APS Electronic).zip / Bavarian #010 (19xx)(APS Electronic).adf / Graph-Routines (.txt) < prev    next >
AmigaBASIC Source Code  |  1988-01-24  |  8KB  |  265 lines

  1. Start:
  2.  
  3. 1 GetLabel:
  4.   WINDOW 2,"Set Label",(1,50)-(600,100)
  5.   LOCATE 1,1
  6.   COLOR 3
  7.   PRINT "Value Indicator"
  8.   LINE (70,9)-(70,13),1
  9.   GET (0,0)-(120,13),mov%
  10.   PUT (0,0),mov%
  11.   CLS
  12.   COLOR 2
  13.   PRINT"Last Value=";Label
  14.   LOCATE 5,40
  15.   COLOR 2,3
  16.   PRINT "Cancel","PI=3.141592654"
  17.   COLOR 2
  18.   LINE (0,20)-(600,20),1
  19.   LINE (2,15)-(2,25),1
  20.   last=MOUSE(1)
  21.   PUT (last-70,10),mov%
  22.   WHILE MOUSE(0)<>-1
  23.     current=MOUSE(1)
  24.     IF last<>current THEN
  25.       PUT (last-70,10),mov%
  26.       last=current
  27.       PUT (last-70,10),mov%
  28.       LOCATE 5,1
  29.       PRINT "Label=";ABS(2-last)/xscale;"            ";
  30.     END IF
  31. WEND
  32. WINDOW 1
  33. WINDOW CLOSE 2
  34. IF MOUSE(2)>30 THEN
  35.   IF last>447 THEN 
  36.     Label=5.30795e-315
  37.   ELSE 
  38.     Label=Label
  39.   END IF
  40. ELSE
  41.   Label=ABS(2-last)/xscale
  42. END IF
  43. CHAIN "Graph-Main",2,ALL
  44.  
  45. 2 Accuracy:
  46.   WINDOW 2,"Accuracy",(1,50)-(600,100)
  47.   LOCATE 1,1
  48.   COLOR 3
  49.   PRINT "Value Indicator"
  50.   LINE (70,9)-(70,13),1
  51.   GET (0,0)-(120,13),mov%
  52.   PUT (0,0),mov%
  53.   LOCATE 5,40
  54.   COLOR 2,3
  55.   PRINT "Cancel"
  56.   COLOR 2
  57.   LOCATE 1,1
  58.   PRINT "Last Setting=";points
  59.   lastp=points
  60.   LINE (0,20)-(600,20),1
  61.   LINE (2,15)-(2,25),1
  62.   last=MOUSE(1)
  63.   PUT (last-70,10),mov%
  64.   WHILE MOUSE(0)<>-1
  65.     current=MOUSE(1)
  66.     IF last<>current THEN
  67.       PUT (last-70,10),mov%
  68.       last=current
  69.       PUT (last-70,10),mov%
  70.       LOCATE 5,1
  71.       PRINT "Accuraccy=";ABS(2-last);"            ";
  72.     END IF
  73. WEND
  74. WINDOW 1
  75. WINDOW CLOSE 2
  76. points=ABS(2-last)
  77. IF MOUSE(2)>30 THEN points=lastp
  78. CHAIN "Graph-Main",2,ALL
  79.  
  80. 3 Help:
  81.   PALETTE 1,0.4,0.75,1
  82.   GET (601,10)-(617,180),mov%
  83.   WINDOW 3,"Help Menu",(12,1)-(630,185),0
  84.   COLOR 3
  85.   LOCATE 1,1
  86.   PRINT TAB(56)"Other Menus"
  87.   PRINT
  88.   COLOR 2
  89.   PRINT TAB(51)"Additional Information"
  90.   PRINT TAB(51)"Quick List"
  91.   PRINT TAB(51)"Changing The Function"
  92.   PRINT TAB(51)"Zooming in on Sections"
  93.   PRINT TAB(51)"Using Accuraccy and Label"
  94.   PRINT 
  95.   PRINT TAB(51)"Exit Help Menu"
  96.   COLOR 3
  97.   LOCATE 1,1
  98.   LINE (0,0)-(392,200),0,bf
  99.   last=2
  100.   GOTO Helpmenu2
  101.  
  102. HelpMenu.Control:
  103.   LINE (394,150)-(600,158),1,bf
  104.   GET (392,150)-(600,159),ve%
  105.   PUT (392,150),ve%
  106.   PUT (392,last*8+7),ve%
  107.   WHILE MOUSE(0)=-1
  108.     COLOR 3
  109.     LOCATE 12,51
  110.     PRINT"Click Right Button  "
  111.     PRINT TAB(51)"Before Making Menu Selection"
  112.   WEND
  113.   LOCATE 12,51
  114.   PRINT "Make Menu Selection"
  115.   PRINT TAB(51)"Then Click Mouse            "
  116.   WHILE MOUSE(0)>-1
  117.     current=INT(MOUSE(2)/8)-1
  118.     IF last<>current AND current>0 AND current<8 THEN
  119.       PUT (392,last*8+7),ve%
  120.       last=current
  121.       PUT (392,last*8+7),ve%
  122.     END IF
  123.   WEND
  124. PUT (392,last*8+7),ve%
  125. LINE (0,0)-(392,200),0,bf
  126. LOCATE 23,50
  127. PRINT " ";
  128. ON last GOTO Helpmenu1,Helpmenu2,Helpmenu3,Helpmenu4,Helpmenu5,Exit.Helpmenu
  129.                 
  130. Exit.Helpmenu:
  131.   WINDOW 1
  132.   WINDOW CLOSE 3
  133.   PALETTE 1,0,1,0
  134.   LINE (0,1)-(0,179),1
  135.   GET (0,1)-(0,179),ve%
  136.   CHAIN "Graph-Main",1,ALL
  137.  
  138. Helpmenu1:
  139.   COLOR 1
  140.   LOCATE 1,1
  141.   PRINT"Graph It V1.0
  142.   PRINT"By Flynn D. Fishman
  143.   PRINT"January 1,1986
  144.   PRINT 
  145.   PRINT"Please Note  that this  is not  the Final version
  146.   PRINT"Since I am waiting for  AmigaBasic  Documentation
  147.   PRINT"I  also  appologize  for the  need  to  Chain but
  148.   PRINT"I  found  that I  could not supply  the program I
  149.   PRINT"Wanted to in 25k."
  150.   PRINT
  151.   PRINT"I have  Also  noticed  that the  Amiga  sometimes
  152.   PRINT"Reboots while  going from one program to  another
  153.   PRINT"If you can  solve this  Bug I would Appreciate it
  154.   PRINT"I believe that it has something to do with Memory
  155.   PRINT"Control.
  156.   PRINT"You can also feel free to enhance this program in
  157.   PRINT"Anyway that you could think off"
  158.   
  159. GOTO HelpMenu.Control  
  160.     
  161. Helpmenu2:
  162.   COLOR 1
  163.   LOCATE 1,1
  164.   PRINT "  -Move the Graph Left"
  165.   PRINT "  -Move the Graph Right"
  166.   PRINT "  -Xpand the Graph On the X-Axis"
  167.   PRINT "  -Move the Graph one Page Right"
  168.   PRINT "  -Move the Graph one Page Left"
  169.   PRINT "  -Move the Graph Up"
  170.   PRINT "  -Move the Graph Down"
  171.   PRINT "  -Expand the Graph On the Y-Axis"
  172.   PRINT "  -Move The Graph up one Page"
  173.   PRINT "  -Move The Graph down one Page"
  174.   PRINT "  -Edit the Spacing Between the Graph's Labels"
  175.   PRINT "  -Edit the Accuracy of the Graph"          
  176.   PRINT "  -Sho ";:COLOR 2:PRINT "(Not Available)";:COLOR 1:PRINT " lculations (X,Y,Slope)"
  177.   PRINT "  -Return to the Origion"
  178.   PRINT "  -Quit and exit to Basic"
  179.   PRINT "  -Help (This menu)"
  180.   FOR i=15 TO 1 STEP -1
  181.      GET (16,i*8)-(375,i*8+8),ve%
  182.      PUT (16,i*8),ve%
  183.      PUT (18,i*10+1),ve%,PSET
  184.   NEXT 
  185.   PUT (0,0),mov%
  186.   LOCATE 22,1
  187.   PRINT "To make a Selection Point to the Desired Icon and
  188.   PRINT "Hold Down Button Until The desired level is reahed";
  189. GOTO HelpMenu.Control  
  190.  
  191. Helpmenu3:
  192.   LOCATE 1,1
  193.   COLOR 3
  194.   PRINT "Changing the Function"
  195.   PRINT
  196.   COLOR 1
  197.   PRINT "In Order to keep this  program Fast
  198.   PRINT "I placed the  Function to be graphed
  199.   PRINT "in the Program as a defined FUNCTION
  200.   PRINT 
  201.   PRINT "In Order to Change the Function"
  202.   PRINT "You Need to change FN Z(x)
  203.   PRINT
  204.   PRINT "You do this by First exiting The Program
  205.   PRINT "By pointing at the Quit Icon
  206.   PRINT "Then
  207.   PRINT "-enter 'LIST FORMULA'"
  208.   PRINT "-delete the old formula
  209.   PRINT "-enter your Formula after the DEF FN z(xmin)="
  210.   PRINT "You Can now run the program with your Function
  211. GOTO HelpMenu.Control
  212.  
  213. Helpmenu4:
  214.   COLOR 3
  215.   LOCATE 1,1
  216.   PRINT "Zooming In on An Area"
  217.   COLOR 1
  218.   PRINT
  219.   PRINT "It is  possible to  Zoom in  on an area by
  220.   PRINT "moving the Mouse to a  point on the graph.
  221.   PRINT "Then  while you  hold down  the Left Mouse
  222.   PRINT "Button,  Move to  the other  Corner of the 
  223.   PRINT "area that you  wish to examine and release
  224.   PRINT "the Right Mouse Button
  225.   PRINT "The Marked Area will now be  displayed
  226.   PRINT 
  227.   PRINT "It is possible to view  more of the graph by
  228.   PRINT "pointing  the  mouse at the Two Expand Icons
  229.   PRINT "And then holding down the  Left Mouse Button
  230.   PRINT "Until the desired size is achieved
  231.   PRINT "Note: That  as you hold  down the button the 
  232.   PRINT "program shows you how much of the screen the
  233.   PRINT "current portion will take in the new Plot"
  234. GOTO HelpMenu.Control
  235.  
  236. Helpmenu5:
  237.   LOCATE 1,1
  238.   COLOR 3
  239.   PRINT "Changing the Accuracy and Labels
  240.   COLOR 1
  241.   PRINT
  242.   PRINT "The Accuracy is defined by how many  Points are"
  243.   PRINT "calculated for each screen There are 600 points"
  244.   PRINT "on the  screen and  and  the  accuracy defaults"
  245.   PRINT "to 100 points
  246.   PRINT "Note that the higher the accuracy the
  247.   PRINT "Slower the Program
  248.   PRINT 
  249.   PRINT "The Labels are the lines that are drawn
  250.   PRINT "On the X and Y axis at set intervals
  251.   PRINT 
  252.   PRINT "To  change  the  accuracy or  the  Labels  First"
  253.   PRINT "Point  to  the  Accuracy  or  Label  Icon and as"
  254.   PRINT "you  hold   down  the  Button   Move  the  value"
  255.   PRINT "Indicater  back   and  forth   along  the  line."
  256.   PRINT "Release the button when you are finished and the
  257.   PRINT "new setting will be used
  258.   PRINT "Note also that  if you do not want a new setting
  259.   PRINT "you can point at the Cancel box when you release
  260.   PRINT "Also  on  the  Label  Setting you can  get PI by
  261.   PRINT "Pointing  at   the  PI  box  when  you   release";
  262. GOTO HelpMenu.Control
  263.  
  264. Finish:
  265.